/*    */ package com.hp.bon.logreverse.bi;
/*    */ 
/*    */ import com.hp.bon.logreverse.ILogFileRead;
/*    */ import com.hp.bon.logreverse.LogDirScan;
/*    */ import java.io.File;
/*    */ import org.slf4j.Logger;
/*    */ import org.slf4j.LoggerFactory;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ 
/*    */ public class BILogDirScan extends LogDirScan
/*    */ {
/* 17 */   private static final Logger LOG = LoggerFactory.getLogger(BILogDirScan.class);
/*    */   private BIMsgProcess biMsgProcess;
/* 21 */   private String recoveredFileName = null;
/*    */ 
/*    */   public void run()
/*    */   {
/* 25 */     LOG.info("BILogDirScan thread start..");
/* 26 */     String startDay = null;
/* 27 */     int startSeq = -1;
/* 28 */     this.recoveredFileName = this.biMsgProcess.getRecoveredFileName();
/* 29 */     if (this.recoveredFileName == null) {
/* 30 */       findFileByStartAndEnd(null, 0, null, 0);
/* 31 */       if (this.curDay != null)
/* 32 */         findFileBySeqWithBlock(this.curDay, this.curSeq + 1);
/*    */     }
/*    */     else {
/* 35 */       startDay = getFileDay(this.recoveredFileName);
/* 36 */       startSeq = getFileSeq(this.recoveredFileName);
/* 37 */       findFileBySeqWithBlock(startDay, startSeq);
/*    */     }
/* 39 */     LOG.info("BILogDirScan thread stopped");
/*    */   }
/*    */ 
/*    */   public void processFile(File file)
/*    */   {
/* 44 */     if (file.getName().equals(this.recoveredFileName))
/*    */     {
/* 46 */       this.biMsgProcess.setRecoveredFile(true);
/*    */     }
/*    */     else
/*    */     {
/* 50 */       this.biMsgProcess.setRecoveredFile(false);
/*    */     }
/* 52 */     this.logFileRead.readAFile(file);
/*    */   }
/*    */ 
/*    */   @Autowired(required=true)
/*    */   public void setBiMsgProcess(BIMsgProcess biMsgProcess) {
/* 57 */     this.biMsgProcess = biMsgProcess;
/*    */   }
/*    */ }

/* Location:           C:\Users\think\Desktop\sgw_2.1.jar
 * Qualified Name:     com.hp.bon.logreverse.bi.BILogDirScan
 * JD-Core Version:    0.6.1
 */